import okhttp3.*;

import java.io.IOException;

public class test {
    public static void main(String[] args) throws IOException {
        OkHttpClient client = new OkHttpClient();

        MediaType mediaType = MediaType.parse("application/json");
        RequestBody body = RequestBody.create(mediaType, "{\"caption\":false,\"dimension\":{\"width\":1080,\"height\":1920},\"video_inputs\":[{\"character\":{\"type\":\"avatar\",\"avatar_id\":\"53d7ecc5eefc4576bc39846f2c0dda9c\",\"scale\":1,\"avatar_style\":\"normal\"},\"voice\":{\"type\":\"text\",\"voice_id\":\"26b2064088674c80b1e5fc5ab1a068eb\",\"input_text\":\"Welcome to the new era of video creation with HeyGen! Simply type your script to get started!\"},\"background\":{\"value\":\"#f6f6fc\",\"type\":\"color\"}}],\"title\":\"Test\"}");
        Request request = new Request.Builder()
                .url("https://api.heygen.com/v2/video/generate")
                .post(body)
                .addHeader("accept", "application/json")
                .addHeader("content-type", "application/json")
                .addHeader("x-api-key", "ZGQ4ODE3MjdiNDZjNDZkODlkYjI0NzA1M2UzMDQxZjItMTczOTE3MzI0Ng==")
                .build();

        Response response = client.newCall(request).execute();
        System.out.println(response);
    }
}
